package project.controllers;

import java.text.SimpleDateFormat;

import api.messages.Messager;

public class Controller {

	private static Integer integerData;
	private static String stringData;
	private DateFormatter dateFormatter = new DateFormatter();
	private ConsoleScanner console_scanner=ConsoleScanner.getInstance();;
	private SimpleDateFormat formatter = new SimpleDateFormat(Messager.DATE_FORMAT);
	private static Controller CONTROLLER;
	
	private Controller(){
	
	}
	
	public static  Controller getInstance(){
		if(CONTROLLER == null){
			CONTROLLER = new Controller();
		}
		return CONTROLLER;
	}

	public String getDate() {
		Printer.printMessage(Messager.DATE);
		stringData = formatter.format(dateFormatter.formatDate());
		return stringData;
	}

	public String getBeginDate() {
		Printer.printMessage(Messager.BEGIN_DATE);
		stringData = formatter.format(dateFormatter.formatDate());
		return stringData;
	}

	public String getEndDate() {
		Printer.printMessage(Messager.END_DATE);
		stringData = formatter.format(dateFormatter.formatDate());
		return stringData;
	}

	public String getBeginingDate() {
		Printer.printMessage(Messager.BEGINING_DATE);
		stringData = formatter.format(dateFormatter.formatDate());
		return stringData;
	}

	public String getFillingDate() {
		Printer.printMessage(Messager.FILLING_DATE);
		stringData = formatter.format(dateFormatter.formatDate());
		return stringData;
	}

	public String getDeadlineDate() {
		Printer.printMessage(Messager.DEADLINE_DATE);
		stringData = formatter.format(dateFormatter.formatDate());
		return stringData;
	}

	public Integer getPrice() {
		Printer.printMessage(Messager.PRICE);
		integerData = console_scanner.getIntData();
		return integerData;
	}

	public Integer getNumberGarage() {
		Printer.printMessage(Messager.GARAGE_NUMBER);
		integerData = console_scanner.getIntData();
		return integerData;
	}	

	public Integer getNumberOrder() {
		Printer.printMessage(Messager.ENTER_ORDER_NUMBER);
		integerData = console_scanner.getIntData();
		return integerData;
	}

	public String getMasterName() {
		Printer.printMessage(Messager.MASTER_NAME);
		stringData = dateFormatter.getString();
		return stringData;
	}
}
